<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=yes">

    <meta content="telephone=yes,email=yes" name="format-detection">
    <!--//自动识别电话号码和邮箱-->

    <meta content="yes" name="apple-mobile-web-app-capable">
    <!--//苹果手机：会删除默认的工具栏和菜单栏，网站开启对web app程序的支持-->
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <!--//苹果手机：在web app应用下状态条（屏幕顶部条）的颜色,默认值为default（白色），可以定为black（黑色）和black-translucent（灰色半透明）。-->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <!--//苹果手机：如果把一个web app添加到了主屏幕中，那么从主屏幕中打开这个web app则全屏显示-->
    <link rel="apple-touch-icon" href="images/HTML5_Badge_64.png"/>
    <!--//苹果手机：将应用添加到手机主屏幕，会有一个icon可以直接进入-->
    <title>有收入</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <!--初始化样式-->
    <link rel="stylesheet" href="css/reset.css">
    <!--共用样式-->
    <link rel="stylesheet" href="css/common.css">
    <!--整个网站的局部样式-->
    <link rel="stylesheet" href="css/style.css">
    <!--适配样式-->
    <link rel="stylesheet" href="css/styleMedia.css">
    <style>
        html, body {
            position: relative;
            overflow-x: hidden;
        }
    </style>
</head>
<body style="background-color: #f4f9fd;">

<!--header begin-->
<header class="header-border-bt">
    <div id="flexHeader">
        <div class="div1 mui-action-back"><a><img src="images/icon_arrow_left.png"></a></div>
        <div class="div2">绑定账号</div>
        <div class="div3"></div>
    </div>
</header>
<!--header end-->

<!--Bind on Account  begin-->
<article class="tab">
        <div class="content-incomplete-tasks">
            <div class="wang-tab-content wang-tab-content-1 transition bind-on-account-main ">
                <main>
                    <p>账号信息必填，银行卡信息与身份证一致</p>
                </main>
                <article class="Bind-on-Account">
                    <div class="put-forward-top" id="listidcard" onclick="pageJump(this)" name="iDCardinfo">
                        <div>
                            <img src="images/icon_star.png">
                        </div>
                        <div><p>身份证信息</p></div>
                        <div><span class="been-bound" id="idcardinfo">身份证信息正在审核中!</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="banknumberdiv" class="put-forward-top" onclick="pageJump(this)" name="bindingBankCard">
                        <div>
                            <img src="images/icon_star.png">
                        </div>
                        <div><p>银行卡 </p></div>
                        <div><span id="banknumber">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="qqnumberdiv" class="put-forward-top" onclick="pageJump(this)" name="bindingQQ">
                        <div>
                            <img src="images/icon_star.png">
                        </div>
                        <div><p>QQ号</p></div>
                        <div><span id="qqnumber" class="been-bound">已绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                </article>
                <main>
                    <p>任意绑定一个号并通过审核即可完成新手任务</p>
                </main>

                <!--binding begin-->
                <article class="Bind-Account-more">
                    <div id="taobaodiv" class="put-forward-top" onclick="pageJump(this)" name="taoBaoBind">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加淘宝账号</p></div>
                        <div><span id="taobao">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="alibabadiv" class="put-forward-top" onclick="pageJump(this)" name="AlibabaBinding">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加阿里巴巴账号</p></div>
                        <div><span id="alibaba">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="pinduoduodiv" class="put-forward-top" onclick="pageJump(this)" name="pinduoduoBind">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加拼多多账号</p></div>
                        <div><span id="pinduoduo">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="meilishuodiv" class="put-forward-top" onclick="pageJump(this)" name="MeilishuoBind">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加美丽说账号</p></div>
                        <div><span id="meilishuo">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="jingdongdiv" class="put-forward-top" onclick="pageJump(this)" name="jinDongBind">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加京东账号</p></div>
                        <div><span id="jingdong">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>
                    <div id="mogujiediv" class="put-forward-top" disabled="disabled" onclick="pageJump(this)" name="mogujiBind">
                        <div>
                            <img src="images/img_taobao.png">
                        </div>
                        <div><p>增加蘑菇街账号</p></div>
                        <div><span id="mogujie">未绑定</span><img src="images/icon_arrow.png"></div>
                    </div>

                </article>
                <!--binding end-->


            </div>
        </div>
</article>

<!--Bind on Account end-->


<!--js-->
<script src="js/jquery-1.12.3.min.js"></script>
<script src="js/common.js"></script>
<script src="js/mui.min.js"></script>
<script src="js/config.js"></script>
<script>
	$(function(){
		
		mui.plusReady(function(){
			$.ajax({
				type:"post",
				url:$CONFIG.baseUrl+"/api/refresh",
				beforeSend:function(x){
					x.setRequestHeader("Authorization",plus.storage.getItem('token'));
				},
				success :function(data){
					
					$("#idcardinfo").text(function(){
						if(!data.data.status){
							return "未绑定";
						}else if(data.data.status == "1"){
							document.getElementById("listidcard").onclick =null;
							return "审核中";
						}else{
							document.getElementById("listidcard").onclick =null;
							return "已绑定";
						}
					})
					$("#banknumber").text(function(){
						console.log(data.data.bankNum)
						if(!data.data.bankNum){
							return "未绑定";
						}else if(data.data.bankNum == "1"){
							document.getElementById("banknumberdiv").onclick =null;
							return "审核中";
						}else{
							document.getElementById("banknumberdiv").onclick =null;
							return "已绑定";
						}
					})
					$("#qqnumber").text(function(){
						console.log(data.data.qq)
						if(!data.data.qq){
							return "未绑定";
						}else if(data.data.qq == "1"){
							document.getElementById("qqnumberdiv").onclick =null;
							return "审核中";
						}else{
							document.getElementById("qqnumberdiv").onclick =null;
							return "已绑定";
						}
					})
					$("#mogujie").text(bangstatu("mogujiediv",data.data.bMogujie))
					$("#taobao").text(bangstatu("taobaodiv",data.data.bTaobao))
					$("#jingdong").text(bangstatu("jingdongdiv",data.data.bJingdong))
					$("#alibaba").text(bangstatu("alibabadiv",data.data.bAlibaba))
					$("#meilishuo").text(bangstatu("meilishuodiv",data.data.bMeilishuo))
					$("#pinduoduo").text(bangstatu("pinduoduodiv",data.data.bPinduoduo))
				},
				error : function(){
					console.log("")
				}
			});
		})
		
		mui.plusReady(function(){
			var user = JSON.parse(plus.storage.getItem('user'));
		})
	
		mui.plusReady(function(){
			var user = JSON.parse(plus.storage.getItem('user'))
			
		});
	})
	function pageJump(dom){
		var name = $(dom).attr('name')
		mui.openWindow({
			url: name+'.html',
			id: name
		})
	}
	function bangstatu(divid,status){
		if(status == null||status == "0"){
			return "未绑定";
		}else if(status == "1"){
			document.getElementById(divid).onclick =null;
			return "审核中";
		}else{
			document.getElementById(divid).onclick =null;
			return "审核通过";
		}
	}
</script>
</body>
</html>